﻿using System.Collections.Generic;
using System.ComponentModel;
using GIMS.GUI.Options;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace GIMS.GUI.Test
{
    
    
    /// <summary>
    ///This is a test class for OptionsWindowViewModelTest and is intended
    ///to contain all OptionsWindowViewModelTest Unit Tests
    ///</summary>
    [TestClass()]
    public class OptionsWindowViewModelTest
    {
        private string imPath = "";

        /// <summary>
        /// Save the initial IMPath
        /// </summary>
        [TestInitialize()]
        public void MyTestInitialize()
        {
            OptionsWindowViewModel target = new OptionsWindowViewModel();
            imPath = target.IMPath;
        }

        /// <summary>
        /// reset the right IMPath after the tests
        /// </summary>
        [TestCleanup()]
        public void MyTestCleanup()
        {
            OptionsWindowViewModel target = new OptionsWindowViewModel();
            target.IMPath = imPath;
        }

        /// <summary>
        ///A test for IMPath
        ///</summary>
        [TestMethod()]
        public void IMPathTest()
        {
            OptionsWindowViewModel target = new OptionsWindowViewModel();
            
            List<string> receivedEvents = new List<string>();
            target.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                receivedEvents.Add(e.PropertyName);
            };

            target.IMPath = "C:\\Users\\";

            Assert.AreEqual("C:\\Users\\", target.IMPath);
            Assert.AreEqual(1, receivedEvents.Count);
        }
    }
}
